//
// Created by Jisam on 2024/6/20.
//
#include <bits/stdc++.h>

using namespace std;

using i64 = long long;

template<class T>
struct Frac {
    T num;
    T den;

    Frac(T num_, T den_) : num(num_), den(den_) {
        if (den < 0) {
            den = -den;
            num = -num;
        }
    }

    Frac() : Frac(0, 1) {}

    Frac(T num_) : Frac(num_, 1) {}

    explicit operator double() const {
        return 1. * num / den;
    }

    Frac &operator+=(const Frac &rhs) {
        num = num * rhs.den + rhs.num * den;
        den *= rhs.den;
        return *this;
    }

    Frac &operator-=(const Frac &rhs) {
        num = num * rhs.den - rhs.num * den;
        den *= rhs.den;
        return *this;
    }

    Frac &operator*=(const Frac &rhs) {
        num *= rhs.num;
        den *= rhs.den;
        return *this;
    }

    Frac &operator/=(const Frac &rhs) {
        num *= rhs.den;
        den *= rhs.num;
        if (den < 0) {
            num = -num;
            den = -den;
        }
        return *this;
    }

    friend Frac operator+(Frac lhs, const Frac &rhs) {
        return lhs += rhs;
    }

    friend Frac operator-(Frac lhs, const Frac &rhs) {
        return lhs -= rhs;
    }

    friend Frac operator*(Frac lhs, const Frac &rhs) {
        return lhs *= rhs;
    }

    friend Frac operator/(Frac lhs, const Frac &rhs) {
        return lhs /= rhs;
    }

    friend Frac operator-(const Frac &a) {
        return Frac(-a.num, a.den);
    }

    friend bool operator==(const Frac &lhs, const Frac &rhs) {
        return lhs.num * rhs.den == rhs.num * lhs.den;
    }

    friend bool operator!=(const Frac &lhs, const Frac &rhs) {
        return lhs.num * rhs.den != rhs.num * lhs.den;
    }

    friend bool operator<(const Frac &lhs, const Frac &rhs) {
        return lhs.num * rhs.den < rhs.num * lhs.den;
    }

    friend bool operator>(const Frac &lhs, const Frac &rhs) {
        return lhs.num * rhs.den > rhs.num * lhs.den;
    }

    friend bool operator<=(const Frac &lhs, const Frac &rhs) {
        return lhs.num * rhs.den <= rhs.num * lhs.den;
    }

    friend bool operator>=(const Frac &lhs, const Frac &rhs) {
        return lhs.num * rhs.den >= rhs.num * lhs.den;
    }

    friend std::ostream &operator<<(std::ostream &os, Frac x) {
        T g = std::gcd(x.num, x.den);
        if (x.den == g) {
            return os << x.num / g;
        } else {
            return os << x.num / g << "/" << x.den / g;
        }
    }
};

using F = Frac<i64>;

/**
 * 解决方案函数，用于判断一个圆是否能在规定时间内通过直线段。
 *
 * @void
 */
void solve() {
    /* 初始化圆心坐标、圆的半径以及移动速度 */
    int x, y, r, xv, yv;
    cin >> x >> y >> r >> xv >> yv;
    /* 初始化直线段的端点坐标 */
    int lx, ly, rx, ry;
    cin >> lx >> ly >> rx >> ry;
    /* 初始化时间变量 */
    F t = 0;
    /* 根据圆的x轴移动方向，更新最短时间 */
    if(xv > 0 ){
        t = max(t,F(lx - (x - r), xv));
    }else if(xv < 0){
        t = max(t,F(rx - (x + r), xv));
    }
    /* 根据圆的y轴移动方向，更新最短时间 */
    if(yv > 0 ){
        t = max(t,F(ly - (y - r), yv));
    }else if(yv < 0){
        t = max(t,F(ry - (y + r), yv));
    }
    /* 判断圆在最短时间后是否完全在直线段内 */
    if (x + t * xv - r >= lx && x + t * xv + r <= rx && y + t * yv - r >= ly && y + t * yv + r <= ry) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}